module App::View
    class Login < Qt::Dialog
        attr_reader :buttonbox
        attr_reader :email, :password, :remember

        def initialize(parent)
            super(parent)

            layout = Qt::VBoxLayout.new

            grid = Qt::GridLayout.new
            grid.addWidget Qt::Label.new("E-mail:"), 0, 0
            @email = Qt::LineEdit.new
            grid.addWidget @email, 0, 1

            grid.addWidget Qt::Label.new("Password:"), 1, 0
            @password = Qt::LineEdit.new
            grid.addWidget @password, 1, 1

            @remember = Qt::CheckBox.new "Remember?"
            grid.addWidget @remember, 2, 1

            layout.addLayout grid

            @buttonbox = Qt::DialogButtonBox.new
            @buttonbox.addButton Qt::DialogButtonBox::Ok
            @buttonbox.addButton Qt::DialogButtonBox::Cancel

            layout.addWidget @buttonbox

            setLayout layout

            show
        end
    end
end
